<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="res/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="res/css/main.css">
<link rel="stylesheet" href="res/css/index.css">
<title>赛程安排</title>
<style>
	.select{
		font-size:24px;
		text-align:center;
	}
</style>
</head>
<body>

	<!-- 导入导航栏 -->
	<div class="layui-container" style="width:100%">
	  	<%@ include file="header.jsp" %> 
  	</div>
  	
  	<div class="layui-container all"></div>
	  <div class="layui-container lower">
		    <div class="layui-row layui-col-space12">
		    	<p class="select"><lable id="name"></lable>运动员赛事成绩统计</p>
				<table id="demo" lay-filter="test" lay-skin="nob"></table>			   	
			</div>
		</div>
		
		<input  type="hidden" name="athleteid" id="athleteid" value="${param.athleteid }">
  	<!-- footer部分 -->
	<div class="layui-container" style="width:100%;margin-top:10px;">
	  	<%@ include file="footer.jsp" %> 
  	</div>
<script src="res/layui/layui.js"></script>
</body>
<script>
layui.use(['table','jquery'], function(){
  var table = layui.table;
  var $ = layui.jquery;

  	var id = $("#athleteid").val();
  	
		
		//第一个实例
		table.render({
			elem : '#demo',
			height : '800px',
			even : true,
			url : 'athletestatistics.action?athleteid=' + id//数据接口
			,
			page : true //开启分页
			,limits: [50,100,150]
     		,limit: 50 //每页默认显示的数量
			,
			done:function(res){
				console.log(res);
			},
			cols : [ [ //表头
			{
				field : 'athletesid',
				title : '编号',
				width : 130
			}, {
				field : 'athletesname',
				title : '姓名'
			}, {
				field : 'projectname',
				title : '项目'
			}	, {
				field : 'collegename',
				title : '学院'
			}, {
				field : 'professionalname',
				title : '专业',
				width : 150
			}, {
				field : 'classname',
				title : '班级',
				width : 180
			}, {
				field : 'itemcategory',
				title : '项目类别',
				templet : function(d) {
					return d.itemcategory == "1" ? "个人赛" : "集体赛"
				}
			}, {
				field : 'agendtype',
				title : '项目组别',
				templet : function(d) {
					return d.agendtype == "1" ? "男子组" : "女子组"
				}
			}, {
				field : 'finalresult',
				title : '成绩'
			}, {
				field : 'finalrank',
				title : '名次'
			}

			] ]
		});


		$.post("SelectAthleteInfo.action",{athleteid:id},function(msg){
				//console.log(msg);
				//console.log(msg.data.athletesname);
				if(msg.data != null){
					document.getElementById('name').innerHTML = msg.data.athletesname;
				}else{
					document.getElementById('name').innerHTML = null;
				}
				
		});
	});
</script>

</html>